package cn.dengta.webapp.trade.dto;

import java.util.Date;

import lombok.*;
import lombok.experimental.Accessors;

@Getter
@Setter
@Accessors(chain = true)
@NoArgsConstructor
public class BiasedBillDTO implements BiasedBill {

	/** 付费者用户ID */
	protected Long payUserId;
	/** 参与交易的另一方用户ID */
	protected Long toUserId;
	/** 是否需要绑定关系 */
	protected boolean bindRequired;
	protected Date now;

	protected boolean useVipFirst = true;

	public BiasedBillDTO(boolean leftIsPayer, Long leftUserId, Long rightUserId, boolean bindRequired, Date now) {
		this(leftIsPayer ? leftUserId : rightUserId, leftIsPayer ? rightUserId : leftUserId, bindRequired, now);
	}

	public BiasedBillDTO(Long payUserId, Long toUserId, boolean bindRequired, Date now) {
		this.payUserId = payUserId;
		this.toUserId = toUserId;
		this.bindRequired = bindRequired;
		this.now = now;
	}

	@Override
	public Date now() {
		return now;
	}

}
